{template header.html}
<script type="text/javascript">
$(function(){
	$(".select-cat").hide();
});
function dr_order() {
    $("#action").val('order');
	var _data = $("#myform").serialize();
	var _url = window.location.href;
	if ((_data.split('ids')).length-1 <= 0) {
		$.dialog.tips("到底排序谁？您还没有选择呢", 2);
		return true;
	}
	// 将表单数据ajax提交验证
	$.ajax({type: "POST",dataType:"json", url: _url, data: _data,
		success: function(data) {
			//验证成功
			if (data.status == 1) {
				$.dialog.tips(data.code, 3, 1);
				// 刷新页
				setTimeout('window.location.reload(true)', 3000);
			} else {
				$.dialog.tips(data.code, 3, 2);
				return true;
			}
		},
		error: function(HttpRequest, ajaxOptions, thrownError) {
			alert(thrownError + "\r\n" + HttpRequest.statusText + "\r\n" + HttpRequest.responseText);
		}
	});
	return false;
}
function dr_delete(catid, id) {
	art.dialog.confirm("你确认要删除吗？", function(){
		// 将表单数据ajax提交验证
		$("#action").val('del');
		var _data = $("#myform").serialize();
		var _url = window.location.href;
		if ((_data.split('ids')).length-1 <= 0) {
			$.dialog.tips("到底删除谁？您还没有选择呢", 2);
			return true;
		}
		// 将表单数据ajax提交验证
		$.ajax({type: "POST",dataType:"json", url: _url, data: _data,
			success: function(data) {
				//验证成功
				if (data.status == 1) {
					$.dialog.tips(data.code, 3, 1);
					// 刷新页
					setTimeout('window.location.reload(true)', 3000);
				} else {
					$.dialog.tips(data.code, 3, 2);
					return true;
				}
			},
			error: function(HttpRequest, ajaxOptions, thrownError) {
				alert(thrownError + "\r\n" + HttpRequest.statusText + "\r\n" + HttpRequest.responseText);
			}
		});
		return true;
	});
	return false;
}
</script>
<input name="page" id="dr_page" type="hidden" value="2" />
<div class="content clearfix">
	{template navigator.html}
    <div class="article">
        <div class="section">
            <div class="title"><strong>{$meta_name}</strong></div>
            <div class="main dr_table">
                {if $is_edit}
				<div class="msearch mbutton">
					<a href="{dr_member_url('category/add')}" class="cur">新增栏目</a>
				</div>
                <div class="bk10"></div>
                {/if}
                <form action="" method="post" name="myform" id="myform">
                <input name="action" id="action" type="hidden" value="" />
				<table style="table-layout:fixed;margin-bottom: 0;">
				<thead>
					<tr>
						<th style="width:30px;" class="algin_c">&nbsp;</th>
						<th style="width:50px;" class="algin_c">排序</th>
						<th class="algin_l">栏目名称</th>
						<th style="width:70px;" class="algin_c">类型</th>
						<th style="width:70px;" class="algin_c">显示</th>
						<th style="width:40px;" class="algin_c"></th>
					</tr>
				</thead>
				<tbody>
				{$list}
				</tbody>
				</table>
                <table style="table-layout:fixed;" class="mbutton">
                <tr>
                    <td style="width:30px;border:none" class="algin_r"><input type="checkbox" onclick="dr_selected()" id="dr_select" name="dr_select"></td>
					<td class="algin_l" style="padding-top:8px;border:none">
                    <button type="button" class="blue_button" onClick="dr_order()">排序</button>
                    {if $is_edit}<button type="button" class="blue_button" onClick="dr_delete()">删除</button>{/if}
                    </td>
                </tr>
				</table>
                </form>
            </div>
        </div>
    </div>
</div>
{template footer.html}